package com.threadExample;

/**
 * Created by yijy on 2017/7/28.
 */
public class ThreadLocalDemo {

    static class Person{
        String name;
        int age;

        public Person(String name, int age) {
            this.name = name;
            this.age = age;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        @Override
        public String toString() {
            return "Person{" +
                    "name='" + name + '\'' +
                    ", age=" + age +
                    '}';
        }
    }

    public static void main(String[] args) {
        Thread thread = new Thread(new MyTask(true),"Jame");
        Thread thread1 = new Thread(new MyTask(true),"Macker");
        Thread thread2= new Thread(new MyTask(false),"John");
        thread.start();
        thread1.start();
        thread2.start();
    }
}
